package org.igeek.config.initAndDestroy;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @package org.igeek.config.initAndDestroy
 * @Description
 * @Author LittlePunk [296526219@qq.ccom]
 * @Version 2022.1
 * @Date 2023/11/14 16:27
 */
@ComponentScan("org.igeek.config.initAndDestroy")
public class MyConfig {
    /*
    * @Bean注解:
    *   name:beanName的名字
    *   initMethod= "方法名"  初始化方法
    *   destroyMethod="方法名"  销毁方法
    * */
    //第三种
    @Bean(name = "cat",initMethod = "initMeth",destroyMethod = "destroyMeth")
    public Cat cat(){
        return new Cat("肥猫");
    }
}
